const { throttle } = require("../../js/newUtil");

// components/advert/index.js
const componentBehavior = require('../../js/common/ComponentBehavior')
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    isShow: {
      value: false,
      type: Boolean
    },
    sourceIndex:{
      value:0,
      type:Number
    },
    source:{
      value:[],
      type:Array
    },
    imgDomain:{
      value:"",
      type:String
    }
  },

  behaviors: [componentBehavior],

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onClickAdvertPacks: throttle(function (e) {
      this.triggerEvent("onClickAdvertPacks", this.data);
    }, 500),
    onCloseAdvertPacks: throttle(function (e) {
      this.triggerEvent("onCloseAdvertPacks", this.data);
    }, 500),
  }
})
